////////////////////////////////////////////////////////////////////////////////
// Filename: light.ps
////////////////////////////////////////////////////////////////////////////////

#include "lightConstBuffer.hlsl"
/////////////
// GLOBALS //
/////////////

SamplerState SampleType;
//Texture2DArray shaderTextures : register(t0);


Texture2D shaderTextures[2];


//////////////
// TYPEDEFS //
//////////////
struct PixelInputType
{
    float4 position : SV_POSITION;
    float2 tex : TEXCOORD0;
	float3 normal : NORMAL;
};


////////////////////////////////////////////////////////////////////////////////
// Pixel Shader
////////////////////////////////////////////////////////////////////////////////
float4 PSMain(PixelInputType input) : SV_TARGET
{
	float4 color1;
    float4 color2;
    float4 blendColor;


    // Get the pixel color from the first texture.
    color1 = shaderTextures[0].Sample(SampleType, input.tex);

    // Get the pixel color from the second texture.
    color2 = shaderTextures[1].Sample(SampleType, input.tex);

    // Blend the two pixels together and multiply by the gamma value.
    blendColor = color1 * color2 * 2.0;
	
	return blendColor;
    
	//float3 lightDir;
	//float lightIntensity;
	
	//float4 color1 = shaderTextures.Sample(SampleType, float3(input.tex, 0));
	//float4 color2 = shaderTextures.Sample(SampleType, float3(input.tex, 1));
	//return (color2);// + color2);

	// Set the default output color to the ambient light value for all pixels.
    //color = float4(0.75,0.75,0.75,1);

	// Invert the light direction for calculations.
	//lightDir = -LightDirection;

	// Calculate the amount of light on this pixel.
	//lightIntensity = saturate(dot(input.normal, float3(0,-1,0.5)));

	//if(lightIntensity > 0.0f)
    //{
        // Determine the final diffuse color based on the diffuse color and the amount of light intensity.
        //color += (float4(1,1,1,1) * lightIntensity);
    //}

	// Saturate the final light color.
	//color = saturate(color);

	// Multiply the texture pixel and the input color to get the final result.
	//color = color * textureColor;
	
	//return color;
}
